Skip to content

fix: when docker build in arm or other not amd64 env.#2492

Merged
sozercan merged 2 commits into
open-policy-agent:masterfrom
yanggangtony:arm-env
Jan 9, 2023
Merged

fix: when docker build in arm or other not amd64 env.#2492
sozercan merged 2 commits into
open-policy-agent:masterfrom
yanggangtony:arm-env

Conversation

@yanggangtony
Copy link
Copy Markdown
Contributor

Signed-off-by: yanggang gang.yang@daocloud.io

What this PR does / why we need it:
/kind bug

Special notes for your reviewer:
When build in arm env , will error , because the RUN curl oras , yg have the constant string 'amd64'.

oras >=0.11.1 , have the arm libs.
yg release also have the arm libs.

Signed-off-by: yanggang <gang.yang@daocloud.io>
@yanggangtony yanggangtony changed the title fix when docker build in arm or other not amd64 env. fix: when docker build in arm or other not amd64 env. Jan 4, 2023
Copy link
Copy Markdown
Member

@ritazh ritazh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ritazh ritazh requested a review from a team January 4, 2023 16:57
Comment thread test/image/Dockerfile

# Install ORAS
RUN curl -SsLO https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz && \
RUN curl -SsLO https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_${arch}.tar.gz && \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

@yanggangtony yanggangtony Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the advice.
I search the web , docker automatic-platform-args-in-the-global-scope.
It says

Automatic platform ARGs in the global scope
This feature is only available when using the [BuildKit](https://docs.docker.com/build/buildkit/) backend.

perhaps in docker build mod , it will no works for ..

Copy link
Copy Markdown
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM, pending sozercan@'s thumbs up

@sozercan sozercan merged commit 85f543c into open-policy-agent:master Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants